﻿using System;
using System.Windows;
using System.Windows.Media;
using System.Collections.Generic;
using System.Windows.Controls;
using System.Windows.Input;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Messaging;
using GalaSoft.MvvmLight.Command;
using Quizzer.Model;
using Quizzer.DataAccess;
using System.Collections.ObjectModel;

namespace Quizzer.ViewModel
{
    [Magic]
    public class TestResultViewModel : ViewModelBase
    {
        public TestResultViewModel()
        {
            Messenger.Default.Register<Attempt>(this, ReceiveMessage);
        }

        private void ReceiveMessage(Attempt attempt)
        {
            ResultsList = QuestionResultRepository.GetQuestionResults(attempt);
        }

        public ObservableCollection<QuestionResult> ResultsList { get; set; }
    }
}
